package com.itheima.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
import org.springframework.stereotype.Component;

import com.rabbitmq.client.Channel;

/**@Description: 消费消息 e
 * @version v1.0
 * @author w
 * @date 2021年8月13日下午1:46:09 
 */
@Component
public class ConsumerListener implements ChannelAwareMessageListener{

	@Override
	public void onMessage(Message message, Channel channel) throws Exception {
        long deliveryTag = message.getMessageProperties().getDeliveryTag();

		System.out.println("消费消息： " + new String(message.getBody()));
		// channel.basicAck(deliveryTag, true);
	}



}
